package com.echat.business.blog.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.echat.business.blog.dao.BlogMapper;
import com.echat.business.blog.model.Blog;
import com.echat.business.blog.service.IBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author chentl123
 * @since 2019-09-05
 */
@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements IBlogService {

    @Autowired
    private BlogMapper blogMapper;

    @Override
    public List<Map<String, Object>> getBlogList(Page<Map<String, Object>> page, Blog blog, String orderBy) {
        List<Map<String, Object>> list = blogMapper.getBlogList(page, blog, orderBy);
        return list;
    }

    @Override
    public List<Map<String, Object>> getBlogsByBlogTypeId(Integer blogTypeId) {
        return this.blogMapper.getBlogsByBlogTypeId(blogTypeId);
    }
}
